import request from '@/utils/request'

// 查询订单信息列表
export function listCrmOrders(query) {
  return request({
    url: '/crm/crmOrders/list',
    method: 'get',
    params: query
  })
}

// 查询订单信息详细
export function getCrmOrders(orderUuid) {
  return request({
    url: '/crm/crmOrders/' + orderUuid,
    method: 'get'
  })
}

// 新增订单信息
export function addCrmOrders(data) {
  console.log(data)
  return request({
    url: '/crm/crmOrders',
    method: 'post',
    data: data
  })
}

// 修改订单信息
export function updateCrmOrders(data) {
  return request({
    url: '/crm/crmOrders',
    method: 'put',
    data: data
  })
}

// 修改订单信息
export function submitConfirm(data) {
  return request({
    url: '/crm/crmOrders/submitConfirm',
    method: 'put',
    data: data
  })
}

// 删除订单信息
export function delCrmOrders(orderDetailUuids) {
  return request({
    url: '/crm/crm/details/' + orderDetailUuids,
    method: 'delete'
  })
}

// 查询客户名称
export function findCustName(query) {

  return request({
    url: '/crm/crm/customers/custName',
    method: 'get',
    params: query
  })
}


// 查询销售人员名称
export function findSeller(query) {
  return request({
    url: '/system/user/:deptId',
    method: 'get',
    params: query
  })
}

// 查询订单明细详细
export function listOrderDetails(query) {
  return request({
    url: '/crm/crm/details/list',
    method: 'get',
    params: query
  })
}
